import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HashLocationStrategy, LocationStrategy } from '@angular/common';
import { HttpClientModule } from '@angular/common/http';

// 根页面
import { RootComponent } from '../component/root.component';
// 根路由
import { RootRouter } from '../router/root.router';

// 登录模块
import { LoginModule } from '../../login/module/login.module';

// 主模块
import { MainModule } from '../../main/module/main.module';

/**
 * 项目的根模块
 */
@NgModule({
  declarations: [
    RootComponent
  ],
  imports: [
    BrowserModule,
    HttpClientModule,

    LoginModule,
    MainModule,
    RootRouter,   /* 跟路由模块需要在最后面导入，不然其他模块的路由都会失效，因为在RootRouter中配置了 path="**" */
  ],
  providers: [
    { provide: LocationStrategy, useClass: HashLocationStrategy }, /* 在根节点后面加一个#锚点,刷新不会404 */
  ],
  bootstrap: [RootComponent]
})
export class RootModule { }

